//
//  LAMapSourceManager.m
//  2bulu-NewAssistant
//
//  Created by Kent Peifeng Ke on 3/20/15.
//  Copyright (c) 2015 È≠èÊñ∞Êù∞. All rights reserved.
//

#import "LAMapSourceManager.h"


@implementation LAMapSourceManager

+(NSArray *)allMapSources
{
        
        //初始的系统默认的图源
        NSMutableArray *orignalMapSourceArray = [NSMutableArray arrayWithCapacity:10];
        
        LAMapSource * googleHybridSateliteMap = [[LAMapSource alloc] initWithUUID:@"10005"];
        googleHybridSateliteMap.name = @"谷歌混合卫星图";
        googleHybridSateliteMap.minZoomScale = 1;
        googleHybridSateliteMap.maxZoomScale = 20;
        googleHybridSateliteMap.coordinateSystem = LACoordinateSystemGCJ02;
        googleHybridSateliteMap.tileSize = 512;
        googleHybridSateliteMap.tileUrlTemplate = @"https://mt0.google.cn/vt/lyrs=y&hl=zh-CN&gl=cn&x={x}&y={y}&z={z}&scale=2";

        googleHybridSateliteMap.isSystemMapSource = YES;
        [orignalMapSourceArray addObject:googleHybridSateliteMap];
        
        LAMapSource * googleSateliteMap = [[LAMapSource alloc] initWithUUID:@"10012"];
        googleSateliteMap.name = @"谷歌卫星图";
        googleSateliteMap.minZoomScale = 1;
        googleSateliteMap.maxZoomScale = 19;//部分历史用户的数据可能是20层
        googleSateliteMap.coordinateSystem = LACoordinateSystemGCJ02;
        googleSateliteMap.tileSize = 512;
        googleSateliteMap.tileUrlTemplate = @"https://mt0.google.cn/vt/lyrs=s&hl=zh-CN&gl=cn&x={x}&y={y}&z={z}&scale=2";

        googleSateliteMap.isSystemMapSource = YES;
        [orignalMapSourceArray addObject:googleSateliteMap];
        
        
        LAMapSource * googleLandMap = [[LAMapSource alloc] initWithUUID:@"10006"];
        googleLandMap.name = @"谷歌地形图";
        googleLandMap.minZoomScale = 1;
        googleLandMap.maxZoomScale = 20;
        googleLandMap.coordinateSystem = LACoordinateSystemGCJ02;
        googleLandMap.tileSize = 512;
        googleLandMap.tileUrlTemplate = @"https://mt0.google.cn/vt/lyrs=t,r&hl=zh-CN&gl=cn&x={x}&y={y}&z={z}&scale=2";
        googleLandMap.isSystemMapSource = YES;
        [orignalMapSourceArray addObject:googleLandMap];
        
        LAMapSource * standardStreet = [[LAMapSource alloc] initWithUUID:@"10000"];
        standardStreet.name = @"高德地图";
        standardStreet.minZoomScale = 1;
        standardStreet.maxZoomScale = 20;
        standardStreet.coordinateSystem = LACoordinateSystemGCJ02;
        standardStreet.tileSize = 0;
        standardStreet.isSystemMapSource = YES;
        [orignalMapSourceArray addObject:standardStreet];
        
        LAMapSource * standardSatellite = [[LAMapSource alloc] initWithUUID:@"10001"];
        standardSatellite.name = @"高德卫星";
        standardSatellite.minZoomScale = 1;
        standardSatellite.maxZoomScale = 20;
        standardSatellite.coordinateSystem = LACoordinateSystemGCJ02;
        standardSatellite.tileSize = 0;
        standardSatellite.isSystemMapSource = YES;
        [orignalMapSourceArray addObject:standardSatellite];
        
        LAMapSource * openStreetMap = [[LAMapSource alloc] initWithUUID:@"10002"];
        openStreetMap.name = @"OpenStreetMap";
        openStreetMap.minZoomScale = 1;
        openStreetMap.maxZoomScale = 18;
        openStreetMap.coordinateSystem = LACoordinateSystemWGS84;
        openStreetMap.tileSize = 256;
        openStreetMap.tileUrlTemplate = @"http://tile.openstreetmap.org/{z}/{x}/{y}.png";
        openStreetMap.isSystemMapSource = YES;
        [orignalMapSourceArray addObject:openStreetMap];
        
        LAMapSource * openCycleMap = [[LAMapSource alloc] initWithUUID:@"10003"];
        openCycleMap.name = @"OpenCycleMap（等高线地图）";
        openCycleMap.minZoomScale = 1;
        openCycleMap.maxZoomScale = 18;
        openCycleMap.coordinateSystem = LACoordinateSystemWGS84;
        openCycleMap.tileSize = 256;
        openCycleMap.tileUrlTemplate = @"http://tile.opencyclemap.org/cycle/{z}/{x}/{y}.png";
        openCycleMap.isSystemMapSource = YES;
        [orignalMapSourceArray addObject:openCycleMap];
        
        LAMapSource * googleStreetMap = [[LAMapSource alloc] initWithUUID:@"10004"];
        googleStreetMap.name = @"谷歌城市交通图";
        googleStreetMap.minZoomScale = 1;
        googleStreetMap.maxZoomScale = 20;
        googleStreetMap.coordinateSystem = LACoordinateSystemGCJ02;
        googleStreetMap.tileSize = 512;
        googleStreetMap.tileUrlTemplate = @"https://mt0.google.cn/vt/lyrs=m&hl=zh-CN&gl=cn&x={x}&y={y}&z={z}&scale=2";
        googleStreetMap.isSystemMapSource = YES;
        [orignalMapSourceArray addObject:googleStreetMap];
        
        LAMapSource * ocmLandscapeMap = [[LAMapSource alloc] initWithUUID:@"10007"];
        ocmLandscapeMap.name = @"OCM+Landscape地形图";
        ocmLandscapeMap.minZoomScale = 1;
        ocmLandscapeMap.maxZoomScale = 18;
        ocmLandscapeMap.coordinateSystem = LACoordinateSystemWGS84;
        ocmLandscapeMap.tileSize = 256;
        ocmLandscapeMap.tileUrlTemplate = @"https://a.tile3.opencyclemap.org/landscape/{z}/{x}/{y}.png";
        ocmLandscapeMap.isSystemMapSource = YES;
        [orignalMapSourceArray addObject:ocmLandscapeMap];
        
        LAMapSource * hikeMap = [[LAMapSource alloc] initWithUUID:@"10008"];
        hikeMap.name = @"徒步+骑行";
        hikeMap.minZoomScale = 1;
        hikeMap.maxZoomScale = 18;
        hikeMap.coordinateSystem = LACoordinateSystemWGS84;
        hikeMap.tileSize = 256;
        hikeMap.tileUrlTemplate = @"http://toolserver.org/tiles/hikebike/{z}/{x}/{y}.png";
        hikeMap.isSystemMapSource = YES;
        [orignalMapSourceArray addObject:hikeMap];
    
        LAMapSource * celesticalMap = [[LAMapSource alloc] initWithUUID:@"10023"];
        celesticalMap.name = @"天体地图";
        celesticalMap.minZoomScale = 1;
        celesticalMap.maxZoomScale = 18;
        celesticalMap.coordinateSystem = LACoordinateSystemWGS84;
        celesticalMap.tileSize = 256;
        celesticalMap.tileUrlTemplate = @"http://t1.tianditu.cn/DataServer?T=cia_w&X={x}&Y={y}&L={z}";
        celesticalMap.isSystemMapSource = YES;
        [orignalMapSourceArray addObject:celesticalMap];
        

        return orignalMapSourceArray;
}




@end
